<template>
  <div>
<!--  在线留言-->
    <div class="lh-main other">

      <div class="lh-other ones">
        <div class="lh-news-box">
          <div class="container" id="contact0">
            <div class="lh-contact-b" id="contact2">
              <h2 class="lh-public-h2">Message</h2>
              <h3 class="lh-public-h3">在线留言</h3>
              <form action="./message/" method="post" onsubmit="return checkForm();">
                <ul class="lh-contact-item clearfix lh-flex">
                  <li> <span>姓名：</span>
                    <input type="text" placeholder="请在此输入您的姓名" name="contacts" id="name">
                  </li>
                  <li> <span>电话：</span>
                    <input type="text" placeholder="请在此输入您的电话号码" name="mobile" id="tel">
                  </li>
                  <li> <span>邮箱：</span>
                    <input type="text" placeholder="请在此输入您的邮箱" name="email">
                  </li>
                  <li> <span>留言：</span>
                    <textarea name="content" placeholder="请在此输入留言内容"></textarea>
<!--                    <a href="javascript:;" onclick="$(&#39;form&#39;).submit()">提交留言&gt;</a>-->
                    <a href="javascript:;" >提交留言&gt;</a>
                  </li>
                </ul>
              </form>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import {testGet} from "@/api/index.js";
import "@/assets/styles/animate.min.css";
import "@/assets/styles/lhcommon.css";
import "@/assets/styles/swiper-4.3.2.min.js";
// import "@/assets/styles/plugin.js";
// import "@/assets/styles/lhpublic.js";
// import "@/assets/styles/layer.js";
// import "@/assets/styles/button.js";
// import "@/assets/styles/bsharec0.js";

export default {
  data() {
    return {};
  },
  created() {
    testGet()
        .then((res) => {
          console.log(res);
        })
        .catch((err) => {
          console.log(err);
        });
  },
};


  function checkForm() {
  if (document.getElementById('name').value.length == 0) {
  alert('您的姓名不能为空！');
  return false;
}
  if (document.getElementById('tel').value.length == 0) {
  alert('您的联系电话不能为空！');
  return false;
}

  return true;
}
</script>
<style>
#baiduMap img {
  width: auto !important;
  min-width: 200% !important;
}
</style>
